<?php
class Application_Model_SolveLog extends Application_Model_DomainObject
{
    protected $_id;
    protected $_solveId;
    protected $_solveType;
    protected $_comment;
    protected $_operator;
    protected $_dateCreated;
    
    const SolveType_Backlog = 1;
    
    public static function addSolveLog($solveId,$solveType,$comment)
    {
        $solveLogItem = new Application_Model_SolveLog();
        $solveLogItem->SolveId = $solveId;
        $solveLogItem->SolveType = $solveType;
        $solveLogItem->Comment = $comment;
        $solveLogItem->Operator = Uuch_Util::getUserNikeName();
        $solveLogItem->DateCreated = date("Y-m-d H:i:s");
        $solveLogItem->save();
    }
    
    public static function getAllBySolveIdType($solveId,$type)
    {
        return self::getDao()->queryAll(array(" solveId = "=>$solveId," and solveType = " => $type));
    }
}